#include "StdAfx.h"
#include "AnyEditor.h"
#include "AnyView.h"
#include "AnyDocument.h"

CAnyEditor::CAnyEditor(void)
:m_pView(NULL),
m_pEditorViewer(NULL)
{
}

CAnyEditor::~CAnyEditor(void)
{
	if(m_pEditorViewer)
	{
		delete m_pEditorViewer;
	}
}
void CAnyEditor::SetEditorViewer(IEditorViewer* pViewer)
{
	if(m_pEditorViewer)
		delete m_pEditorViewer;

	m_pEditorViewer = pViewer;
}
void CAnyEditor::OnChangeParam(UINT nID)
{
	ASSERT(m_pEditorViewer);
	if(m_pEditorViewer)
	{
		m_pEditorViewer->OnChangeParam(nID);
		Preview();
	}
}
TDF_Label CAnyEditor::GetRootLabel()
{
	return m_pView->GetDocument()->GetRootLabel();
}
void CAnyEditor::Initialize(CAnyView* pView)
{
	m_pView = pView;
}

CRenderEngine* CAnyEditor::GetRender()
{
	return m_pView->GetRender();
}
EditorState CAnyEditor::Start(void)
{
	return ES_CONTINUE;
}
void CAnyEditor::Finish(void)
{
}
void CAnyEditor::Abort(void)
{
}
void CAnyEditor::Preview()
{
}

EditorState CAnyEditor::OnLButtonDown(UINT nFlags, long x, long y)
{
	return ES_CONTINUE;
}
EditorState CAnyEditor::OnLButtonUp(UINT nFlags, long x, long y)
{
	return ES_CONTINUE;
}
void CAnyEditor::OnMouseMove(UINT nFlags, long x, long y)
{

}
EditorState CAnyEditor::OnRButtonDown(UINT nFlags, long x, long y)
{
	return ES_CONTINUE;
}
EditorState CAnyEditor::OnRButtonUp(UINT nFlags, long x, long y)
{
	return ES_CONTINUE;
}
EditorState CAnyEditor::OnMouseWheel(UINT nFlags, short zDelta, long x, long y)
{
	return ES_CONTINUE;
}
EditorState CAnyEditor::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
	return ES_CONTINUE;
}
EditorState CAnyEditor::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
	return ES_CONTINUE;
}
EditorState CAnyEditor::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
	return ES_CONTINUE;
}
void CAnyEditor::OnContextMenu(const CMenuContext& contextMenu)
{
};